Visual Studio 2005 Tech Preview on MSDN

Microsoft has posted the Visual Studio 2005 Tech Preview on MSDN.

The Black Art of Using ActiveSync with the Emulator.

Intro:

It has always really annoyed me that we could not use ActiveSync with Visual Studio
.NET’s emulator.  This would allow developers an easy way of deploying files
to and from the emulator, using the familar drag and drop explorer window. 
There are ways around this.  A developer can use the Remote File Viewer, that
comes with eMbeed Visual C++.  If you have the latest version installed you can
usually find it here, C:\Program Files\Windows CE Tools\Common\Platman\bin\wce420\cefilevw.exe. 
But it just wasn’t as easy as ActiveSync, since it doesn’t support drag and drop among
other things.  Also developer’s need the ability to use the Emulator’s new features
such as Folder
Sharing
and the VirtualSwitch.

Microsoft recently released a Developer Power Toy, called Emulator ActiveSync Connection
Tool, that allows Activesync to connect to your Emulator session from Visual Studio
.NET 2003.  To date, I know of no one who has gotten this to work and believe
me I have tried.
(Replace the Indy car with a screenshot of ActiveSync to simulate my post Power Toy
mind set.)

After much fruitless effort trying to get the Emulator ActiveSync Connection Tool
to function, I decided to go about this another way.  My plan was to get ActiveSync
to work with the eMbedded Visual C++ 4.0 SP 2.0’s emulator and use that inside Visual
Studio .NET after the ActiveSync connection was started.  After some initial
struggles mostly due mostly to lack of documentation, I have manage to get everything
working!

Related Resources:

Changing
Ethernet Support in the Emulator

Using
ActiveSync over Virtual Switch

Windows
Mobile Developer Power Toys: Emulator ActiveSync Connection Tool

J.T.
Teh’s microsoft.public.pocketpc.activesync newsgroup post on Using the emulator with
ActiveSync

Steps:
01. Open eMbedded Visual C++ 4.0 SP 2.0.
         NOTE: If you do
not have eVC++ you can download it: eVC++
4.0
, and eVC++
4.0 SP3
.
         NOTE: You will
need to install, SDK
for Windows Mobile 2003-based Pocket PCs
after the above.
         NOTE: Start,
All Programs, Microsoft eMbedded Visual C++ 4.0, eMbedded Visual C++ 4.0
02. Click on Tools, then Configure Platform Manager.
03. Expand POCKET PC 2003.
04. Select POCKET PC 2003 Emulator.
05. Click on Properties….
06. Select Emulator Startup Server for Startup Server.
07. Click on Configure… next to Startup Server.
08. Under Communication, Ethernet should be set to VirtualSwitch.
         NOTE: This
allows the emulator to appear on your LAN and have ingoing and outgoing TCP/IP communication.
09. Click on OK.
10. Click on Test.
         NOTE: Make
sure the emulator is not already running.
         NOTE: Make
sure you do NOT have the XP Firewall software enabled.
         NOTE: Make
sure you do NOT have a wireless LAN connection or hardware active.
         NOTE: You should
hear some type of musical fanfare play on successful completion.
         NOTE: You must
have some form of physical ethernet install on desktop.
         NOTE: You may
need to install
Microsoft Loopback Adapter
.

The emulator is now configured to appear on your network.

01. Click on Start, All Programs, …, Microsoft Pocket PC 2003 SDK.

02. Click on the Pocket PC 2003 SDK
         NOTE: This
is a command prompt window.
03. Type EmuASCfg.exe /?
         NOTE: This
is the Emulator ActiveSync Configuration program.
         NOTE: This
requires the .NET runtime files to be installed on the Desktop machine.
04. Type EmuASCfg.exe /PPC
         NOTE: This
will use XML provisioning files to configure the ActiveSync connection.
         NOTE: Here
is some detail information on what is happening in step 4 above:

         Desktop:

             The
following key is installed in the desktop’s registry.  It is completely undocumented!    
             NOTE: I
assume the VirtualSwitch mimics a wireless connection, but I have not tested.
     
             [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
CE Services]
             ”TreatRemoteAsLocal”=dword:00000001

             Emulator:

     
             The
following keys are installed in the emulator’s registry.  This can be done manuall
using Remote Registry Editor.
             NOTE: You
should be able to find Remote Registry Editor here: 
                  C:\Program
Files\Windows CE Tools\Common\Platman\bin\wce420\ceregedt.exe

             [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
CE Services\Partners]
             ”PCur”=dword:00000001
             [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
CE Services\Partners\P1]
             ”PId”=dword:00000001
             ”PName”=”<NAME p

             example:
             ”PName”=”HomePC”

The emulator is now configured to use ActiveSync to connect to your Desktop.

On the Pocket PC 2003 Emulator do the following.
01. Click on Start, ActiveSync, Sync.
02. That should do it.  You should now have an emulator that is connected
through ActiveSync.

Conclusion:

We can now use the emulator with ActiveSync.  We can also use the emulator with
ActiveSync in Visual Studio .NET.
All we need to do is have the emulator connected with ActiveSync and choose to deploy
to Pocket PC Device,

inside Visual Studio .NET.  This means that we can use the Advanced features
of the eMbedded Visual C++ 4.0 SP 2.0’s

emulator like Folder Sharing, and the VirtualSwitch for better TCP/IP communications.

Life is good…

Troubleshooting:

Anyone who has ever used ActiveSync knows that either all the planets are aligned
just right or you will go home sounding like this
I’ve tried to post as many links and notes as possible, but some of you are going
to get this to work with the first try, and some of you will never get this to work. 
Hopefully, it isn’t quite that bad, but if you have any issues please post a comment
and I’ll try to help, or maybe someone else will know the answer.

LScript Development Tool Update

I got a reply from someone at Microsoft today stating the tool would be released shortly,
but it would probably be after the MDC.  Joy, joy, that will be a fun
tool to work with. 


eXTReMe Tracker